#include <iostream>
#include <stdlib.h>
#include <string>

using namespace std;

class A
{
public:
	A(){cout<<"A"<<endl;}
	virtual ~A(){cout<<"~A"<<endl;}
};

class B:public A
{
public:
	B():A(){cout<<"B"<<endl;}
	~B(){cout<<"~B"<<endl;}
};

int main()
{
	A* b = new B();
	delete b;
	cout<<"main over"<<endl;
	
	return 0;
}


